import { useAppSelector, useAppDispatch } from './hooks'
import { add } from './store/reducers/counter'

function App() {
  const counter = useAppSelector((store) => store.counter.count)
  const dispatch = useAppDispatch()

  const btnHandler = () => {
    dispatch(add(1))
  }

  return (
    <div className="App">
      <h1>App 组件</h1>
      <p>count 的值是：{counter}</p>
      <button className="btn btn-primary" onClick={btnHandler}>
        +1
      </button>
    </div>
  )
}

export default App
